package com.example.redis.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.listener.ChannelTopic;

@Configuration
public class TopicConfig {

    public static final String SSE_TOPIC_NAME = "topic:queue";
    public static final String LOG_TOPIC_NAME = "topic:log";
    public static final String BACK_BACKCALCULTE_TOPIC_NAME = "topic:back_calculte";

    @Bean
    public ChannelTopic logTopic() {
        return new ChannelTopic(LOG_TOPIC_NAME);
    }
    //订阅发布的主题
    @Bean
    public ChannelTopic sseTopic() {
        return new ChannelTopic(SSE_TOPIC_NAME);
    }

    @Bean
    public ChannelTopic yarnBackCalculteTopic() {
        return new ChannelTopic(BACK_BACKCALCULTE_TOPIC_NAME);
    }

}